﻿Ext.define('CB.controller.Users', {
    extend: 'Ext.app.Controller',
    views: ['user.List',
    'user.Edit'],
    init: function () {
        //console.log('Esto inicia antes que la aplicacion');
        this.control({
            //'viewport > panel': { render: this.onPanelRendered }
            'userlist': {
                itemdblclick: this.editUser
            }
        });
    },
    editUser: function (grid, record) {
        //console.log('Doble clic en ' + record.get('name'));
        var view = Ext.widget('useredit');
        view.down('form').loadRecord(record);
    }

    /*onPanelRendered: function () {
    console.log('Panel mostrado!');
    }*/
});